<!DOCTYPE html>
<html lang="">
<head>
    <meta charset="utf-8">
    <title>会员充值</title>
    <link rel="stylesheet" type="text/css" href="res/font-awesome.css">
    <link rel="shortcut icon" type="image/ico" href="https://www.wuzhaoqi.top/web/favicon.ico">
    <script type="text/javascript" src="js/axios.js"></script>
    <script type="text/javascript" src="js/vue.js"></script>
    <script type="text/javascript" src="js/jquery-3.5.1.js"></script>
    <script type="text/javascript" src="js/Popup.js"></script>
    <link href="layui/css/layui.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="layui/layui.js"></script>
    <script type="text/javascript" src="layer/layer.js"></script>
    <link rel="stylesheet" type="text/css" href="res/main.css">
    <script type="text/javascript">
        //注意：导航 依赖 element 模块，否则无法进行功能性操作
        layui.use('element', function () {
            var element = layui.element;

            //…
        });


        var search = location.search;
        var urlPy = "pay.do?op=returnPay&" + search
        var money = 0;
        if (search == null || search === "") {

        } else {
            axios.get(urlPy).then(res => {
                money = parseInt(res.data)
                var urlVip = "user.do?op=vipCZ&money=" + money;
                axios.get(urlVip).then(res => {
                	alertLayer
                	
                	(res.data,"Recharge.html");
                });
            });
        }


    </script>
</head>

<body class="layui-layout-body">
<div id="main">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header header">
            <ul class="layui-nav warp">
                <li class="layui-nav-item ">
                    <a href="vip.html">最新活动</a>
                </li>
                <li class="layui-nav-item layui-this">
                    <a href="Recharge.html">会员续费/充值</a>
                </li>
                <li class="layui-nav-item"><a href="viprights.html">会员权益</a></li>
                <li class="layui-nav-item"><a href="">社区</a></li>
                <li class="layui-nav-item" style="float: right;">
                    <a href=""><img :src="user.head" class="layui-nav-img"></a>
                    <dl class="layui-nav-child">
                        <dd><a href="member.html" style="color: #0C0C0C">个人中心</a></dd>
                        <dd><a href="javascript:;" style="color: #0C0C0C">修改密码</a></dd>
                        <dd><a href="vip.html" style="color: #0C0C0C">会员中心</a></dd>
                        <dd><a onclick="returnLogin()" style="color: #0C0C0C">退出登录</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div id="member" class="member">
        <div class="layui-side layui-bg-black ">
            <div class="layui-side-scroll">
                <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                <ul class="layui-nav layui-nav-tree" lay-filter="test">

                </ul>
            </div>
        </div>

        <div class="layui-body m-right">

            <br> <br> <br> <br>
            <div>
                当前帐号：
                <p v-text="user.name"></p>
                <br>
                <span id="vip1" v-if="isVip">会员有效期至<h5 v-text="user.vipTime"></h5></span>
                <span id="vip2" v-if="isVip === false">会员已经在：<h5 v-text="user.vipTime +'  过期'"></h5> </span>

            </div>

            <br> <br>
            <div class="layui-btn-group">
                <button type="button" class="layui-btn layui-btn-primary "
                        style="width: 80px;height: 80px"
                        @click="payVip3">一年
                </button>
                <button type="button" class="layui-btn layui-btn-lg "
                        style="width: 150px;height: 80px"
                        @click="payVip3">99￥
                </button>
            </div>

            <div class="layui-btn-group">
                <button type="button" class="layui-btn layui-btn-primary "
                        style="width: 80px;height: 80px" @click="payVip2">三个月
                </button>
                <button type="button" class="layui-btn layui-btn-lg  " style="width: 150px;height: 80px"
                        @click="payVip2">30￥
                </button>
            </div>

            <div class="layui-btn-group">
                <button type="button" class="layui-btn layui-btn-primary" style="width: 80px;height: 80px"
                        value="15"
                        @click="payVip1">一个月
                </button>
                <button type="button" class="layui-btn layui-btn-lg  " style="width: 150px;height: 80px"
                        value="15"
                        @click="payVip1">15￥
                </button>
            </div>

            <br>
            <br>
            <br>
            <br>
            <br>

            <div><h5>点击按钮即可跳转支付</h5> <br><img src="images/支付宝.png" style="width: 50px"> &nbsp;&nbsp;&nbsp;
                支付宝APP扫码支付，随机立减
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">

    var na = new Vue({
        el: "#main",
        data: {
            user: {
                id: 0,
                name: "",
                nickname: "",
                pwd: "",
                phone: "",
                email: "",
                qq: "",
                head: "",
                rank: "",
                glod: "",
                createTime: "",
                vipTime: ""
            },
            isVip: false,
        },
        created() {
            axios.get("user.do?op=isVip").then((res) => {
                if (res.data === "0") {
                    this.isVip = true;
                }
            });
            var url = "user.do?op=queryUser"
            axios.get(url).then((res) => {
                if (res.data === "请先登录 !") {
                    gotoLogin();
                }
                this.user = res.data;
                axios.get("user.do?op=timeSF&time=" + this.user.vipTime).then((res) => {
                    this.user.vipTime = res.data;
                });


            });


        },
        methods: {

            payVip1() {
                //var url2 = "pay.do?op=payVip";
                var url2 = "http://www.wuzhaoqi.top:8080/C91-S2-XM/order/confirm?money=" + "15";
                url2.substring(0, url2.length - 1)
                window.location.href = url2;
            },
            payVip2() {
                //var url2 = "pay.do?op=payVip";
                var url2 = "http://www.wuzhaoqi.top:8080/C91-S2-XM/order/confirm?money=" + "30";
                window.location.href = url2;
            },
            payVip3() {
                //var url2 = "pay.do?op=payVip";
                var url2 = "http://www.wuzhaoqi.top:8080/C91-S2-XM/order/confirm?money=" + "99";
                window.location.href = url2;
            },

            query() {
                var url = "user.do?op=queryUser"
                axios.get(url).then((res) => {
                    this.user = res.data;
                    axios.get("user.do?op=timeSF&time=" + this.user.vipTime).then((res) => {
                        this.user.vipTime = res.data;
                    });
                });
            }
        }


    })


</script>
</body>

</html>
